Skip to content

720-fixes-for-kdb-x - #721

Merged
samuel-prescott merged 1 commit into
masterfrom
720-fixes-for-kdb-x
Dec 19, 2025
Merged

samuel-prescott merged 1 commit into
masterfrom
720-fixes-for-kdb-x

Conversation

@samuel-prescott

@samuel-prescott samuel-prescott commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor

added missing ";" which caused assign error in checkinputs.q
updated .gw.setserverstate parameter name in gateway.q from keyword "use" to "usestate"

@samuel-prescott samuel-prescott self-assigned this Dec 19, 2025
@samuel-prescott samuel-prescott linked an issue Dec 19, 2025 that may be closed by this pull request
@samuel-prescott
samuel-prescott merged commit e62d73e into master Dec 19, 2025
@jaen15marcos jaen15marcos mentioned this pull request Nov 18, 2026
jaen15marcos added a commit that referenced this pull request Dec 4, 2026
* Make the data-access postback work

- .checkinputs.checkpostback rejected every postback. Its two checks look
  for a sync key, which is not a valid parameter (checkparamnames rejects
  any request that has one), and signal
  .schema.errors[`asyncpostback;`errormessage], which errormessages.csv
  does not define, so the error message was empty. Before #721 the two
  lines were missing their semicolons and never ran; once they ran, no
  postback got through. The check now asks the gateway: .gw.call says
  whether the caller's request is synchronous, and a postback on a sync
  request is refused with the existing checkpostback message ("Postback
  key only allowed for async requests"). On a process that is not a
  gateway, .gw.call does not exist and the check passes.

- The gateway posts back (postback;query;result), and the client calls
  postback[query;result], while the data-access checks only accept a
  postback that takes one argument (the docs show {0N!x}). So even before
  #721 a valid postback failed with 'rank on the client. The gateway now
  hands asyncexecjpt {[f;q;r] f r}[postback], which takes the query and
  the result and gives the user's function the result.

Through the gateway, an async getdata with the postback {`pbres set count
x} now sets pbres to the row count on the client, and a sync getdata with
a postback is refused with "Postback key only allowed for async requests".

* Initialise the data-access API at start-up when discovery is off; write three of its checks portably

- .dataaccess.init runs on every new connection (.servers.connectcustom),
  and a process normally makes one at start-up, to discovery. Under a
  connection limit, such as KDB-X's free licence (16 connections), TorQ
  turns discovery off (#727), so a process with no other connection to
  make never got the data-access API, and most data-access tests failed
  there. With discovery off, init now also runs once at the end of
  start-up, and a failure there is only logged, as on a new connection.
  With discovery on nothing changes.
- .checkinputs.checkeachparam iterates over the row indices of the
  parameter table rather than over the table itself, which not every q
  implementation can iterate. The result is the same.
- .eqp.extractoptimisationkey sets optimisation from the request, or 1b,
  instead of filling one dictionary into another with ^.
- readtableproperties writes its "all or blank" proctype list as ``all
  rather than `all` - the same two symbols - as some q implementations'
  functional selects return nothing when a literal symbol list ends with
  the null symbol.

* Fix two data-access tests

- dataaccess/gwquerytest: since #639 the RDB advertises its partition
  through .rdb.getpartition, which processes/rdb.q defines. The test's
  mock RDB does not load rdb.q and only set .rdb.rdbpartition, so
  .proc.getattributes failed, the gateway held no attributes for it, and
  every query routed to the RDB got "no info found for that table name
  and time range". The mock RDB now defines .rdb.getpartition as well.
- dataaccess/queryorder loaded its HDB with \l hdb, which is
  $TORQHOME/hdb, not the test's own HDB with the attribute helpers.

* Keep master's data-access forms and rename columns only when asked

checkeachparam iterates over the config table again, and
readtableproperties writes the symbol list as enlist`all` again. Both
were rewritten for q engines that read them differently from kdb+. The
current builds of those engines read master's forms as kdb+ does, so the
rewrites are no longer needed.

getdata renames its result's columns only where the query asks for a
rename. Without one it called xcol with an empty dictionary, which kdb+
accepts and which gives 'type on some q engines, so every getdata call
failed there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fixes for KDB-X

2 participants